package com.guosheng.json;

import com.alibaba.fastjson.JSON;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Jsonone {

    public static void main(String[] args) {

        Map<String,Object> test1 = new HashMap<>();
        test1.put("one", Arrays.asList(1,2,3,4,5,6,7,8));
        JsonEntityTest jet = new JsonEntityTest();
        jet.setAge(18);
        jet.setName("guoshengceshi");
        jet.setPrice(18.8);
        jet.setProducts(Arrays.asList("shen diao xia lv","tian long ba bu","duo qing jian ke wu qing jian"));
        test1.put("two",jet);
        test1.put("three",3);
        test1.put("four","mei you wen ti");
        String json = JSON.toJSONString(test1);
        System.out.println(json);
        String bbb = json;
        bbb = JsonUtil.jsonDelArray(bbb);
        System.out.println(json);
        System.out.println(bbb);

     /*  System.out.println(JsonUtil.jsonUpdateArrayToNull(json));
       System.out.println(JsonUtil.testIsObject1(JsonUtil.jsonUpdateArrayToNull(json)));
       System.out.println(JsonUtil.jsonDelArray(bbb));*/



    }
}
